import datetime

class Comment:
    # 属性
    says_id = int
    says_time = datetime.datetime.now().strftime("%Y-%m-%d")
    says = str
    goods_id = int
    user_id = int
    username = str
    order_id = int

    # 改造python entity
    there = dict()
    #构造函数
    def __init__(self,says_id, says_time, says, goods_id, user_id, username, order_id):
        '''评论表:Comment实体类的构造函数'''
        self.says_id = says_id
        self.says_time = says_time
        self.says = says
        self.goods_id = goods_id
        self.user_id  = user_id
        self.username = username
        self.order_id = order_id
        
    def __str__ (self):
        return f"Comment(says_id={self.says_id},says_time={self.says_time},says={self.says},goods_id={self.goods_id},user_id={self.user_id},username={self.username},order_id={self.order_id})"
    
    def __repr__(self):
        return f"Comment(says_id={self.says_id}, says_time={self.says_time},says={self.says},goods_id={self.goods_id},user_id={self.user_id},tusernameype={self.username},order_id={self.order_id})"

    def __json__(self):
        return {"says_id": self.user_id, 
                "says_time": self.says_time, 
                "says": self.says, 
                "goods_id": self.goods_id, 
                "user_id": self.user_id, 
                "username": self.username,
                "order_id": self.order_id}